home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickDraw3D 1.6 SDK / Mac Interfaces / CIncludes / QD3DShader.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-18  |  8.5 KB  |  313 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QD3DShader.h
  3.  
  4.      Contains:    QuickDraw 3D Shader / Color Routines                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.6
  7.                  Release:    QuickTime 4.0
  8.  
  9.      Copyright:    © 1995-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QD3DSHADER__
  18. #define __QD3DSHADER__
  19.  
  20. #ifndef __QD3D__
  21. #include <QD3D.h>
  22. #endif
  23. #ifndef __MOVIES__
  24. #include <Movies.h>
  25. #endif
  26.  
  27.  
  28.  
  29. #if PRAGMA_ONCE
  30. #pragma once
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40.  
  41. #if PRAGMA_STRUCT_ALIGN
  42.     #pragma options align=power
  43. #elif PRAGMA_STRUCT_PACKPUSH
  44.     #pragma pack(push, 2)
  45. #elif PRAGMA_STRUCT_PACK
  46.     #pragma pack(2)
  47. #endif
  48.  
  49. #if PRAGMA_ENUM_ALWAYSINT
  50.     #pragma enumsalwaysint on
  51. #elif PRAGMA_ENUM_OPTIONS
  52.     #pragma option enum=int
  53. #elif PRAGMA_ENUM_PACK
  54.     #if __option(pack_enums)
  55.         #define PRAGMA_ENUM_PACK__QD3DSHADER__
  56.     #endif
  57.     #pragma options(!pack_enums)
  58. #endif
  59.  
  60. /******************************************************************************
  61.  **                                                                             **
  62.  **                                RGB Color routines                             **
  63.  **                                                                             **
  64.  *****************************************************************************/
  65. EXTERN_API_C( TQ3ColorRGB *)
  66. Q3ColorRGB_Set                    (TQ3ColorRGB *            color,
  67.                                  float                     r,
  68.                                  float                     g,
  69.                                  float                     b);
  70.  
  71. EXTERN_API_C( TQ3ColorARGB *)
  72. Q3ColorARGB_Set                    (TQ3ColorARGB *            color,
  73.                                  float                     a,
  74.                                  float                     r,
  75.                                  float                     g,
  76.                                  float                     b);
  77.  
  78. EXTERN_API_C( TQ3ColorRGB *)
  79. Q3ColorRGB_Add                    (const TQ3ColorRGB *    c1,
  80.                                  const TQ3ColorRGB *    c2,
  81.                                  TQ3ColorRGB *            result);
  82.  
  83. EXTERN_API_C( TQ3ColorRGB *)
  84. Q3ColorRGB_Subtract                (const TQ3ColorRGB *    c1,
  85.                                  const TQ3ColorRGB *    c2,
  86.                                  TQ3ColorRGB *            result);
  87.  
  88. EXTERN_API_C( TQ3ColorRGB *)
  89. Q3ColorRGB_Scale                (const TQ3ColorRGB *    color,
  90.                                  float                     scale,
  91.                                  TQ3ColorRGB *            result);
  92.  
  93. EXTERN_API_C( TQ3ColorRGB *)
  94. Q3ColorRGB_Clamp                (const TQ3ColorRGB *    color,
  95.                                  TQ3ColorRGB *            result);
  96.  
  97. EXTERN_API_C( TQ3ColorRGB *)
  98. Q3ColorRGB_Lerp                    (const TQ3ColorRGB *    first,
  99.                                  const TQ3ColorRGB *    last,
  100.                                  float                     alpha,
  101.                                  TQ3ColorRGB *            result);
  102.  
  103. EXTERN_API_C( TQ3ColorRGB *)
  104. Q3ColorRGB_Accumulate            (const TQ3ColorRGB *    src,
  105.                                  TQ3ColorRGB *            result);
  106.  
  107. EXTERN_API_C( float *)
  108. Q3ColorRGB_Luminance            (const TQ3ColorRGB *    color,
  109.                                  float *                luminance);
  110.  
  111. /******************************************************************************
  112.  **                                                                             **
  113.  **                                Shader Types                                 **
  114.  **                                                                             **
  115.  *****************************************************************************/
  116.  
  117. enum TQ3ShaderUVBoundary {
  118.     kQ3ShaderUVBoundaryWrap        = 0,
  119.     kQ3ShaderUVBoundaryClamp    = 1
  120. };
  121. typedef enum TQ3ShaderUVBoundary TQ3ShaderUVBoundary;
  122.  
  123.  
  124. /******************************************************************************
  125.  **                                                                             **
  126.  **                                Shader Routines                                 **
  127.  **                                                                             **
  128.  *****************************************************************************/
  129. EXTERN_API_C( TQ3ObjectType )
  130. Q3Shader_GetType                (TQ3ShaderObject         shader);
  131.  
  132. EXTERN_API_C( TQ3Status )
  133. Q3Shader_Submit                    (TQ3ShaderObject         shader,
  134.                                  TQ3ViewObject             view);
  135.  
  136. EXTERN_API_C( TQ3Status )
  137. Q3Shader_SetUVTransform            (TQ3ShaderObject         shader,
  138.                                  const TQ3Matrix3x3 *    uvTransform);
  139.  
  140. EXTERN_API_C( TQ3Status )
  141. Q3Shader_GetUVTransform            (TQ3ShaderObject         shader,
  142.                                  TQ3Matrix3x3 *            uvTransform);
  143.  
  144. EXTERN_API_C( TQ3Status )
  145. Q3Shader_SetUBoundary            (TQ3ShaderObject         shader,
  146.                                  TQ3ShaderUVBoundary     uBoundary);
  147.  
  148. EXTERN_API_C( TQ3Status )
  149. Q3Shader_SetVBoundary            (TQ3ShaderObject         shader,
  150.                                  TQ3ShaderUVBoundary     vBoundary);
  151.  
  152. EXTERN_API_C( TQ3Status )
  153. Q3Shader_GetUBoundary            (TQ3ShaderObject         shader,
  154.                                  TQ3ShaderUVBoundary *    uBoundary);
  155.  
  156. EXTERN_API_C( TQ3Status )
  157. Q3Shader_GetVBoundary            (TQ3ShaderObject         shader,
  158.                                  TQ3ShaderUVBoundary *    vBoundary);
  159.  
  160.  
  161. /******************************************************************************
  162.  **                                                                             **
  163.  **                            Illumination Shader    Classes                         **
  164.  **                                                                             **
  165.  *****************************************************************************/
  166. EXTERN_API_C( TQ3ObjectType )
  167. Q3IlluminationShader_GetType    (TQ3ShaderObject         shader);
  168.  
  169. EXTERN_API_C( TQ3ShaderObject )
  170. Q3PhongIllumination_New            (void);
  171.  
  172. EXTERN_API_C( TQ3ShaderObject )
  173. Q3LambertIllumination_New        (void);
  174.  
  175. EXTERN_API_C( TQ3ShaderObject )
  176. Q3NULLIllumination_New            (void);
  177.  
  178.  
  179. /******************************************************************************
  180.  **                                                                             **
  181.  **                                 Surface Shader                                 **
  182.  **                                                                             **
  183.  *****************************************************************************/
  184. EXTERN_API_C( TQ3ObjectType )
  185. Q3SurfaceShader_GetType            (TQ3SurfaceShaderObject  shader);
  186.  
  187.  
  188. /******************************************************************************
  189.  **                                                                             **
  190.  **                                Texture Shader                                 **
  191.  **                                                                             **
  192.  *****************************************************************************/
  193. EXTERN_API_C( TQ3ShaderObject )
  194. Q3TextureShader_New                (TQ3TextureObject         texture);
  195.  
  196. EXTERN_API_C( TQ3Status )
  197. Q3TextureShader_GetTexture        (TQ3ShaderObject         shader,
  198.                                  TQ3TextureObject *        texture);
  199.  
  200. EXTERN_API_C( TQ3Status )
  201. Q3TextureShader_SetTexture        (TQ3ShaderObject         shader,
  202.                                  TQ3TextureObject         texture);
  203.  
  204.  
  205. /******************************************************************************
  206.  **                                                                             **
  207.  **                                Texture Objects                                 **
  208.  **                                                                             **
  209.  *****************************************************************************/
  210. EXTERN_API_C( TQ3ObjectType )
  211. Q3Texture_GetType                (TQ3TextureObject         texture);
  212.  
  213. EXTERN_API_C( TQ3Status )
  214. Q3Texture_GetWidth                (TQ3TextureObject         texture,
  215.                                  unsigned long *        width);
  216.  
  217. EXTERN_API_C( TQ3Status )
  218. Q3Texture_GetHeight                (TQ3TextureObject         texture,
  219.                                  unsigned long *        height);
  220.  
  221.  
  222. /******************************************************************************
  223.  **                                                                             **
  224.  **                                Pixmap Texture                                 **
  225.  **                                                                             **
  226.  *****************************************************************************/
  227. EXTERN_API_C( TQ3TextureObject )
  228. Q3PixmapTexture_New                (const TQ3StoragePixmap * pixmap);
  229.  
  230. EXTERN_API_C( TQ3Status )
  231. Q3PixmapTexture_GetPixmap        (TQ3TextureObject         texture,
  232.                                  TQ3StoragePixmap *        pixmap);
  233.  
  234. EXTERN_API_C( TQ3Status )
  235. Q3PixmapTexture_SetPixmap        (TQ3TextureObject         texture,
  236.                                  const TQ3StoragePixmap * pixmap);
  237.  
  238.  
  239. /******************************************************************************
  240.  **                                                                             **
  241.  **                                Mipmap Texture                                 **
  242.  **                                                                             **
  243.  *****************************************************************************/
  244. EXTERN_API_C( TQ3TextureObject )
  245. Q3MipmapTexture_New                (const TQ3Mipmap *        mipmap);
  246.  
  247. EXTERN_API_C( TQ3Status )
  248. Q3MipmapTexture_GetMipmap        (TQ3TextureObject         texture,
  249.                                  TQ3Mipmap *            mipmap);
  250.  
  251. EXTERN_API_C( TQ3Status )
  252. Q3MipmapTexture_SetMipmap        (TQ3TextureObject         texture,
  253.                                  const TQ3Mipmap *        mipmap);
  254.  
  255. /******************************************************************************
  256.  **                                                                             **
  257.  **                    Compressed Pixmap Texture                                 **
  258.  **                                                                             **
  259.  *****************************************************************************/
  260. EXTERN_API_C( TQ3TextureObject )
  261. Q3CompressedPixmapTexture_New    (const TQ3CompressedPixmap * compressedPixmap);
  262.  
  263. EXTERN_API_C( TQ3Status )
  264. Q3CompressedPixmapTexture_GetCompressedPixmap (TQ3TextureObject  texture,
  265.                                  TQ3CompressedPixmap *    compressedPixmap);
  266.  
  267. EXTERN_API_C( TQ3Status )
  268. Q3CompressedPixmapTexture_SetCompressedPixmap (TQ3TextureObject  texture,
  269.                                  const TQ3CompressedPixmap * compressedPixmap);
  270.  
  271. EXTERN_API_C( TQ3Status )
  272. Q3CompressedPixmapTexture_CompressImage (TQ3CompressedPixmap * compressedPixmap,
  273.                                  PixMapHandle             sourcePixMap,
  274.                                  CodecType                 codecType,
  275.                                  CodecComponent         codecComponent,
  276.                                  short                     codedDepth,
  277.                                  CodecQ                 codecQuality);
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285. #if PRAGMA_ENUM_ALWAYSINT
  286.     #pragma enumsalwaysint reset
  287. #elif PRAGMA_ENUM_OPTIONS
  288.     #pragma option enum=reset
  289. #elif defined(PRAGMA_ENUM_PACK__QD3DSHADER__)
  290.     #pragma options(pack_enums)
  291. #endif
  292.  
  293. #if PRAGMA_STRUCT_ALIGN
  294.     #pragma options align=reset
  295. #elif PRAGMA_STRUCT_PACKPUSH
  296.     #pragma pack(pop)
  297. #elif PRAGMA_STRUCT_PACK
  298.     #pragma pack()
  299. #endif
  300.  
  301. #ifdef PRAGMA_IMPORT_OFF
  302. #pragma import off
  303. #elif PRAGMA_IMPORT
  304. #pragma import reset
  305. #endif
  306.  
  307. #ifdef __cplusplus
  308. }
  309. #endif
  310.  
  311. #endif /* __QD3DSHADER__ */
  312.  
  313.